home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15586 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: dialup-24.melbpc.org.au!dward
  2. From: dward@melbpc.org.au (Darren Ward)
  3. Newsgroups: comp.lang.c
  4. Subject: Probs with prototype mixes with Functions
  5. Date: Sat, 20 Apr 1996 12:21:08 UTC+10
  6. Organization: Melbourne PC User Group, Australia
  7. Message-ID: <dward.1.000DC9CA@melbpc.org.au>
  8. NNTP-Posting-Host: dialup-24.melbpc.org.au
  9. Keywords: function
  10. X-Newsreader: Trumpet for Windows [Version 1.0 Rev B final beta #4]
  11.  
  12. Could anyone help me with the following?
  13.  
  14. when making a function such as:
  15.     
  16. float convert(int celcius)
  17. {
  18.     float faranheit;
  19.     faranheit = ((float)celcius*9/5)+32;
  20.     return faranheit;
  21. }
  22.  
  23. and it is called by the main program as
  24.  
  25.  
  26.     faran = convert(celc);
  27.  
  28. where faran is a float and celc is an int.
  29.  
  30.  
  31. The problem is that I can't compile it as it keeps giving me errors on return 
  32. type but as far as I can see the main is waiting for a float and the function 
  33. should return a float?
  34.  
  35. Any help would be greatly appreciated.
  36.  
  37. Darren
  38.   ,-._|\  Darren Ward                        Limit to about 76 cols->
  39.  /  Oz  \ Mail Address, Phone, Fax. Member, Melbourne PC User Group.
  40.  \_,--.x/ Edit/replace text but don't exceed 4 lines as per netiquette.
  41.        v  ++++ Fancy borders count as a line ~~~~~~~~~~-----++++++++++
  42.